<%@ page language="java" contentType="text/html; charset=UTF-8" trimDirectiveWhitespaces="true"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include.inc.jsp"%>

<dwz:paginationForm action="${contextPath}/fileResource/list" page="${page}" onsubmit="return navTabSearch(this)">
</dwz:paginationForm>
<form method="post" action="${contextPath }/fileResource/list" onsubmit="return navTabSearch(this)">
	<div class="pageHeader">
		<div class="searchBar">
			<ul class="searchContent">
				
				<li>
					<label>文件名：</label>
					<input type="text" name=search_LIKE_name value="${param.search_LIKE_name}"/>
				</li>
			</ul>
			<div class="subBar">
				<ul>						
					<li><div class="button"><div class="buttonContent"><button type="submit">搜索</button></div></div></li>
				</ul>
			</div>
		</div>
	</div>
</form>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<shiro:hasPermission name="FileResource:upload">
			<li><a iconClass="page_white_get" mask="true" target="dialog" rel="lookup2fileResource_upload" width="440" height="300"  href="${contextPath}/fileResource/upload/file"><span>上传到文件系统</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="FileResource:upload">
			<li><a iconClass="server_database" mask="true" target="dialog" rel="lookup2fileResource_upload" width="440" height="300"  href="${contextPath}/fileResource/upload/db"><span>上传到数据库</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="FileResource:edit">
			<li><a iconClass="page_white_edit" target="dialog"  rel="lookup2fileResource_edit" width="440" height="200" mask="true" href="${contextPath}/fileResource/edit/{slt_uid}"><span>编辑资源</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="FileResource:delete">
			<li><a iconClass="page_white_delete" class="delete" target="selectedTodo" rel="ids"  title="确认要删除用户吗?"   href="${contextPath}/fileResource/delete"><span>删除资源</span></a></li>
			</shiro:hasPermission>
		</ul>
	</div>
	<table class="table" layoutH="135" width="100%">
		<thead>
			<tr>
						<th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
						<th>文件名</th>
						<th>文件尺寸</th>
						<th>存储类型</th>
						<th>文件类型</th>
						<th>UUID(下载标志)</th>
						<th>上传时间</th>
						<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="item" items="${fileResourceList}">
			<tr target="slt_uid" rel="${item.id}">
				
						<td><input name="ids" value="${item.id}" type="checkbox"></td>
						
						<td>${item.name}</td>
						<td>${item.size}</td>
						<td>
							<c:if test="${item.storeType=='file'}">
							文件系统
							</c:if>
							<c:if test="${item.storeType=='db'}">
							数据库
							</c:if>
						</td>
						<td>${item.fileType}</td>
						<td>${item.uuid}</td>
						<td><fmt:formatDate value="${item.uploadTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
						<td>
							<shiro:hasPermission name="Resource:download">
								<a iconClass="page_white_put" target="_blank" href="${contextPath}/fileResource/download/${item.uuid}" title="下载">下载</a>
							</shiro:hasPermission>
						</td>
			</tr>
			</c:forEach>
		</tbody>
	</table>
	
	<!-- 分页 -->
	<dwz:pagination page="${page}" />

	
</div>